/*
 * Copyright the original author or authors.
 * 
 * Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.mozilla.org/MPL/MPL-1.1.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 package com.blitscreen.gesture
{
	import com.blitscreen.render.BlitSprite;
	import com.bourre.events.BasicEvent;
	
	/**
	 * Event object dispatched by the <code>GestureManager</code>
	 * with its events.
	 * 
	 * @author	Cédric Néhémie
	 * @see		GestureManager
	 * @see		GestureListener
	 */
	public class GestureEvent extends BasicEvent
	{
		/**
		 * Constant which store the name of the <code>onPress</code> event.
		 */
		static public const onPressEVENT : String = "onPress";
		/**
		 * Constant which store the name of the <code>onRelease</code> event.
		 */
		static public const onReleaseEVENT : String = "onRelease";
		/**
		 * Constant which store the name of the <code>onReleaseOutside</code> event.
		 */
		static public const onReleaseOutsideEVENT : String = "onReleaseOutside";
		/**
		 * Constant which store the name of the <code>onRollOver</code> event.
		 */
		static public const onRollOverEVENT : String = "onRollOver";
		/**
		 * Constant which store the name of the <code>onRollOut</code> event.
		 */
		static public const onRollOutEVENT : String = "onRollOut";
		/**
		 * Constant which store the name of the <code>onDragOver</code> event.
		 */
		static public const onDragOverEVENT : String = "onDragOver";
		/**
		 * Constant which store the name of the <code>onDragOut</code> event.
		 */
		static public const onDragOutEVENT : String = "onDragOut";
		
		/**
		 * A reference to the sprite that interact with the mouse.
		 */
		public var sprite : BlitSprite;
		
		/**
		 * Creates a new <code>GestureEvent</code> object for the passed-in 
		 * event <code>type</code> with the passed-in <code>sprite</code> 
		 * and an optional <code>source</code> object.
		 * 
		 * @param type	 <code>String</code> name of the event
		 * @param sprite <code>BlitSprite</code> object which interact with the mouse
		 * @param source <code>GestureManager</code> source for the event
		 * @see	  GestureManager
		 */
		public function GestureEvent( type : String, sprite : BlitSprite, source : Object = null )
		{
			super( type, source );
			this.sprite = sprite;
		}

		/**
		 * Returns a reference to the <code>BlitSprite</code> object which
		 * currently interact with the mouse.
		 * 
		 * @return <code>BlitSprite</code> object which currently interact
		 * 		   with the mouse.
		 */
		public function getSprite () : BlitSprite
		{
			return sprite;
		}
	}
}